import 'package:flutter/material.dart';

class MyListView extends StatelessWidget {
  MyListView({super.key});

  final nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

  @override
  Widget build(BuildContext context) {
    return ScrollConfiguration(
        behavior: const ScrollBehavior().copyWith(
          scrollbars: false, // 禁用滚动条
        ),
        child: ListView(
          physics: const BouncingScrollPhysics(),
          scrollDirection: Axis.vertical,
          children: nums
              .map((e) => Container(
                    height: 100,
                    color: Colors.primaries[e % Colors.primaries.length],
                    child: Text(
                      e.toString(),
                      textAlign: TextAlign.center,
                    ),
                  ))
              .toList(),
          // children: const [
          //   ListTile(
          //     title: Text('111'),
          //   ),
          //   ListTile(
          //     title: Text('222'),
          //   ),
          //   ListTile(
          //     title: Text('333'),
          //   ),
          //   ListTile(
          //     title: Text('444'),
          //   ),
          //   ListTile(
          //     title: Text('555'),
          //   ),
          //   ListTile(
          //     title: Text('666'),
          //   ),
          // ],
        ));
  }
}
